CREATE TABLE [dbo].[CustomerInfo]
(
[CustomerInfoId] [int] NOT NULL IDENTITY(1, 1),
[AccountId] [int] NULL,
[CityId] [int] NOT NULL,
[PaymentTypeId] [int] NULL,
[FirstName] [nvarchar] (128) COLLATE Cyrillic_General_CI_AS NOT NULL,
[MiddleName] [nvarchar] (128) COLLATE Cyrillic_General_CI_AS NOT NULL,
[LastName] [nvarchar] (128) COLLATE Cyrillic_General_CI_AS NOT NULL,
[PostIndex] [int] NULL,
[PostAddress] [nvarchar] (256) COLLATE Cyrillic_General_CI_AS NULL,
[Phone] [nvarchar] (40) COLLATE Cyrillic_General_CI_AS NULL,
[Icq] [int] NULL,
[Skype] [nvarchar] (256) COLLATE Cyrillic_General_CI_AS NULL,
[Email] [nvarchar] (256) COLLATE Cyrillic_General_CI_AS NULL,
[CreatedDate] [datetime] NOT NULL,
[LastModifiedDate] [datetime] NOT NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[CustomerInfo] ADD CONSTRAINT [PK_CustomerInfo] PRIMARY KEY CLUSTERED  ([CustomerInfoId]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[CustomerInfo] ADD CONSTRAINT [FK_CustomerInfo_Account] FOREIGN KEY ([AccountId]) REFERENCES [dbo].[Account] ([AccountId])
GO
ALTER TABLE [dbo].[CustomerInfo] ADD CONSTRAINT [FK_CustomerInfo_City] FOREIGN KEY ([CityId]) REFERENCES [dbo].[City] ([CityId])
GO
ALTER TABLE [dbo].[CustomerInfo] ADD CONSTRAINT [FK_CustomerInfo_PaymentType] FOREIGN KEY ([PaymentTypeId]) REFERENCES [dbo].[PaymentType] ([PaymentTypeId])
GO
